import request, {METHODS} from '@/service/request';
import envConf from '@/conf/env.conf';

// 提现
export function balance({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/balance`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 退押金
export function deposit({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/deposit`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 获取计划详情
export function plan({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/plan`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}
// 获取计划列表
export function palns({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/palns`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 获取文本
export function Texts({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Texts`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 阅读报告
export function BookstorePlanReport({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePlan/report`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}


// 书屋某天计划实际
export function BookstorePlanCounts({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePlan/counts`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}


// 书屋计划相关删除
export function BookstorePlanDel({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePlan`,
        method: METHODS.DELETE,
        data,
        success,
        fail,
        complete,
    });
}


// 书屋计划相关添加
export function BookstorePlanAdd({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePlan`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}
// 书屋计划相关某天计划
export function BookstorePlan({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePlan`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋计划相关列表
export function BookstorePlans({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePlans`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋打卡某一天的数据
export function BookstorePunchGet({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePunch/get`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋打卡首页日历数据
export function BookstorePunchCalendar({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePunch/calendar`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋打卡首页数据
export function BookstorePunch({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePunch`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋添加打卡
export function BookstorePunchAdd({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/BookstorePunch/add`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋删除书籍
export function BookstoreDelBookstore({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/delBookstore`,
        method: METHODS.DELETE,
        data,
        success,
        fail,
        complete,
    });
}

// 分类内添加书屋书籍
export function addBookstoreSortId({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/addBookstoreSortId`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}


// 搜索添加书籍
export function BookstoreAddSearchBookstore({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/addSearchBookstore`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 扫码添加书籍
export function BookstoreAddSIBNBookstore({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/addSIBNBookstore`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 手动添加书籍
export function BookstoreAddManualBookstore({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/addManualBookstore`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋列表
export function BookstoreListBookstore({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/listBookstore`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋分类列表
export function BookstoreListSort({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/listSort`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋分类删除
export function BookstoreDelSort({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/delSort`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋分类编辑
export function BookstorePutSort({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/putSort`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}

// 书屋添加分类
export function BookstoreAddSort({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Bookstore/addSort`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}


// 合伙人当月推广
export function PartnershipDYtuiguang({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership/DYtuiguang`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 合伙人当月订单
export function PartnershipDYdingdan({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership/DYdingdan`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 合伙人当月扫码
export function PartnershipDYsaoma({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership/DYsaoma`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 合伙人当月佣金
export function PartnershipDYyongjin({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership/DYyongjin`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 合伙人我的合伙人
export function PartnershipHehuoren({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership/hehuoren`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 合伙人提现数据
export function PartnershipYongjin({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership/yongjin`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}

// 合伙人首页数据
export function Partnership({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Partnership`,
        method: METHODS.GET,
        data,
        success,
        fail,
        complete,
    });
}


// 绑定合伙人关系
export function addShare({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/addShare`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

// 绑定合伙人关系
export function Binding({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/Binding`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 获取短信验证码
 */
export function sendCode({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/sendCode`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 获取当前售卖会员卡
 */
export function getVipCards({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/cards`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 会员卡下单支付
 */
export function cardOrder({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/cardOrder`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 查询支付是否成功
 */
export function getCardOrder({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/cardOrder`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 查询用户的会员卡
 */
export function getMcards({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/mcards`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 会员卡激活
 */
export function putMcards({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/mcards`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 会员卡详情
 */
export function vipCardDetails({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/cardDetails`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 会员卡赠送
 */
export function giveMcardt({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/mcardt`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 收获地址列表
 */
export function addressList({ data, success, fail, complete, method}) {
    return request({
        url: `xcxapi/contacts`,
        method,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 收获地址增删改查
 */
export function contactsAddress({ data, success, fail, complete, method}) {
    return request({
        url: `xcxapi/contact`,
        method,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 默认收获地址
 */
export function defaultAddress({ data, success, fail, complete, method}) {
    return request({
        url: `xcxapi/contacta`,
        method,
        data,
        success,
        fail,
        complete,
    });
}


/**
 * 订单列表（书籍和会员卡订单）
 */
export function booksOrders({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/booksOrders`,
        data,
        success,
        fail,
        complete,
    });
}


/**
 * 书籍订单的接口（增查改）
 */
export function booksOrder({ data, success, fail, complete, method}) {
    return request({
        url: `xcxapi/booksOrder`,
        method: method,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 下单
 */
export function trueBooksOrder({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/trueBooksOrder`,
        method: 'PUT',
        data,
        success,
        fail,
        complete,
    });
}


/**
 * 查询动态分类
 */
export function showSort({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/showSort`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 取消订单
 */
export function cancelOrder({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/booksOrder0`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}


/**
 * 确认收货
 */
export function receiveGoods({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/booksOrder30`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 订单发货
 */
export function orderShipment({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/booksOrder40`,
        method: METHODS.PUT,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 帮助中心列表
 */
export function getHelpList({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/helps`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 帮助中心详情
 */
export function getHelpDetail({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/help`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 金额相关
 */
export function getMoney({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/money`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 金额明细
 */
export function getMoneyDetail({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/moneys`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 物流查询
 */
export function inquiryLogistics({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/ed`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 快递公司查询
 */
export function inquiryLogisticsCom({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/eds`,
        data,
        success,
        fail,
        complete,
    });
}


/**
 * 用户礼品卡
 */
export function inquiryGiftCards({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/gifts`,
        data,
        success,
        fail,
        complete,
    });
}

/**
 * 用户礼品卡
 */
export function getGiftCards({ data, success, fail, complete}) {
    return request({
        url: `xcxapi/gift`,
        method: METHODS.POST,
        data,
        success,
        fail,
        complete,
    });
}
